"""
数据输入
"""
from pyspark import SparkConf, SparkContext

conf = SparkConf().setMaster("local[*]").setAppName("wordcount")
sc = SparkContext(conf=conf)

# 通过 parallelize() 方法创建 RDD
# rdd1 = sc.parallelize([1, 2, 3, 4])
# rdd2 = sc.parallelize((1,2,3,4))
# rdd3 = sc.parallelize({"a":1, "b":2, "c":3})
# rdd4 = sc.parallelize("hello world")
# print(rdd1.collect())
# print(rdd2.collect())
# print(rdd3.collect())
# print(rdd4.collect())

rdd = sc.textFile("01-PySpark实战-前言介绍.py")
print(rdd.collect())
sc.stop()